Skip to content

Add Java CLI reverse-engineering challenges and bundle JAR variants#2523

Merged
commjoen merged 14 commits into
masterfrom
copilot/add-cli-challenge-variants
May 19, 2026
Merged

Add Java CLI reverse-engineering challenges and bundle JAR variants#2523
commjoen merged 14 commits into
masterfrom
copilot/add-cli-challenge-variants

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

This adds WrongSecrets challenges based on the new Java CLIs introduced in OWASP/wrongsecrets-binaries#130. It covers both the plain and obfuscated Java variants and includes the relevant bundled artifacts, including CTF builds.

  • New challenges

    • Add Challenge65 for the plain Java CLI JAR
    • Add Challenge66 for the obfuscated Java CLI JAR
    • Register both challenges in wrong-secrets-configuration.yaml with matching explanation, hint, and reason content
  • Java JAR execution support

    • Extend BinaryExecutionHelper to execute runnable JARs via java -jar
    • Reuse the existing binary challenge flow so spoil() resolves the embedded secret from the packaged CLI rather than duplicating logic in application code
  • Bundled Java artifacts

    • Add the Java CLI variants under src/main/resources/executables/
      • wrongsecrets-java.jar
      • wrongsecrets-java-obfuscated.jar
      • wrongsecrets-java-ctf.jar
      • wrongsecrets-java-obfuscated-ctf.jar
    • Update .gitignore so these tracked JARs can live alongside the existing executable assets
    • Copy the new Java JAR variants into both desktop container images so they are available in the desktop reverse-engineering environment
  • Challenge docs and tests

    • Add focused AsciiDoc content for both Java challenges
    • Refine the hints and explanation content based on review feedback to emphasize reverse-engineering the JARs rather than relying on spoil
    • Add challenge tests covering the new plain and obfuscated JAR-backed flows

Example of the new execution path:

@Override
public String getAnswer() {
  BinaryExecutionHelper helper = new BinaryExecutionHelper(65, new MuslDetectorImpl());
  return helper.executeJavaJar("", "wrongsecrets-java.jar");
}

Copilot AI and others added 3 commits May 11, 2026 05:25
Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/f2ea090d-47bb-4e0a-ad4c-179c568545a8

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/f2ea090d-47bb-4e0a-ad4c-179c568545a8

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
You can solve it by:

1. Decompiling the classes and following the code that reconstructs the secret.
2. Looking for encoded byte arrays, reflection, and helper methods that decode data at runtime.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot can you be more explicit in the steps here please? what does the user exactly need to do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with explicit step-by-step instructions for decompiling, inspecting bytecode, and running the JAR locally in 928795e.

Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/ffd37450-0343-442a-abee-851241cb0eff

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
Copilot AI temporarily deployed to github-pages May 11, 2026 07:03 Inactive
Copilot AI requested a review from commjoen May 11, 2026 07:03
@github-actions
Copy link
Copy Markdown

🌐 GitHub Pages Preview Ready!

Your static preview is now available at:
🔗 Preview PR #2523

📄 What's included:

For full functionality testing: Use the Docker preview instead.

🔄 Auto-updates: This preview will be updated automatically when you push new commits to this PR.


Static preview with Thymeleaf generation by GitHub Actions

@github-actions
Copy link
Copy Markdown

🔨 Preview Build Complete!

Your changes have been built and pushed to GitHub Container Registry.

🐳 Docker Image: ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-6714add

📦 Download & Test Locally:

  1. 📁 Download Docker Image Artifact (look for wrongsecrets-preview-pr-2523)
  2. Load and run the image:
# Download the artifact, extract it, then:
docker load < wrongsecrets-preview.tar
docker run -p 8080:8080 -p 8090:8090 wrongsecrets-preview

🚀 Alternative - Pull from Registry:

docker pull ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-6714add
docker run -p 8080:8080 -p 8090:8090 ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-6714add

Then visit: http://localhost:8080

📝 Changes in this PR:
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge65.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge66.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/binaryexecution/BinaryExecutionHelper.java
- src/main/resources/explanations/challenge65.adoc
- src/main/resources/explanations/challenge65_hint.adoc
- src/main/resources/explanations/challenge65_reason.adoc
- src/main/resources/explanations/challenge66.adoc
- src/main/resources/explanations/challenge66_hint.adoc
- src/main/resources/explanations/challenge66_reason.adoc

Visual diff screenshots will be available shortly...


Preview built by GitHub Actions

@github-actions
Copy link
Copy Markdown

📸 Visual Diff Ready!

Screenshots comparing your changes with the main branch are available:

📁 Download Visual Diff Artifacts

🖼️ Included screenshots:

  • pr-home.png vs main-home.png - Welcome page comparison
  • pr-about.png vs main-about.png - About page comparison
  • pr-challenge.png vs main-challenge.png - Challenge page comparison

🔍 How to review:

  1. Download the artifact zip file
  2. Extract and compare the pr-* and main-* images side by side
  3. Look for visual differences in layout, styling, and content

💡 Tip: Use an image comparison tool or open both images in separate browser tabs to spot differences easily.


Visual diff generated by GitHub Actions • PR #2523

@commjoen commjoen marked this pull request as ready for review May 15, 2026 10:03
@commjoen commjoen requested a review from bendehaan as a code owner May 15, 2026 10:03
@commjoen
Copy link
Copy Markdown
Collaborator

@copilot can you update the documentaiton as well please?

@github-actions
Copy link
Copy Markdown

🌐 GitHub Pages Preview Ready!

Your static preview is now available at:
🔗 Preview PR #2523

📄 What's included:

For full functionality testing: Use the Docker preview instead.

🔄 Auto-updates: This preview will be updated automatically when you push new commits to this PR.


Static preview with Thymeleaf generation by GitHub Actions

Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/f5613696-4b1f-4899-844f-53b020e7c5e3

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot can you update the documentaiton as well please?

Updated the Challenge 66 explanation text as well so the main documentation now walks through downloading the JAR, running spoil, decompiling it, tracing the decoding logic, and submitting the recovered secret in 63dc675.

@github-actions
Copy link
Copy Markdown

🔨 Preview Build Complete!

Your changes have been built and pushed to GitHub Container Registry.

🐳 Docker Image: ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-2a33460

📦 Download & Test Locally:

  1. 📁 Download Docker Image Artifact (look for wrongsecrets-preview-pr-2523)
  2. Load and run the image:
# Download the artifact, extract it, then:
docker load < wrongsecrets-preview.tar
docker run -p 8080:8080 -p 8090:8090 wrongsecrets-preview

🚀 Alternative - Pull from Registry:

docker pull ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-2a33460
docker run -p 8080:8080 -p 8090:8090 ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-2a33460

Then visit: http://localhost:8080

📝 Changes in this PR:
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge65.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge66.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/binaryexecution/BinaryExecutionHelper.java
- src/main/resources/explanations/challenge65.adoc
- src/main/resources/explanations/challenge65_hint.adoc
- src/main/resources/explanations/challenge65_reason.adoc
- src/main/resources/explanations/challenge66.adoc
- src/main/resources/explanations/challenge66_hint.adoc
- src/main/resources/explanations/challenge66_reason.adoc

Visual diff screenshots will be available shortly...


Preview built by GitHub Actions

@github-actions
Copy link
Copy Markdown

📸 Visual Diff Ready!

Screenshots comparing your changes with the main branch are available:

📁 Download Visual Diff Artifacts

🖼️ Included screenshots:

  • pr-home.png vs main-home.png - Welcome page comparison
  • pr-about.png vs main-about.png - About page comparison
  • pr-challenge.png vs main-challenge.png - Challenge page comparison

🔍 How to review:

  1. Download the artifact zip file
  2. Extract and compare the pr-* and main-* images side by side
  3. Look for visual differences in layout, styling, and content

💡 Tip: Use an image comparison tool or open both images in separate browser tabs to spot differences easily.


Visual diff generated by GitHub Actions • PR #2523

Copilot AI temporarily deployed to github-pages May 17, 2026 20:56 Inactive
@commjoen
Copy link
Copy Markdown
Collaborator

@copilot instead of using spoil, how could an attacker find the array and decode it instead? Can you use that as the hints steps?

@github-actions
Copy link
Copy Markdown

🔨 Preview Build Complete!

Your changes have been built and pushed to GitHub Container Registry.

🐳 Docker Image: ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-3a62fd2

📦 Download & Test Locally:

  1. 📁 Download Docker Image Artifact (look for wrongsecrets-preview-pr-2523)
  2. Load and run the image:
# Download the artifact, extract it, then:
docker load < wrongsecrets-preview.tar
docker run -p 8080:8080 -p 8090:8090 wrongsecrets-preview

🚀 Alternative - Pull from Registry:

docker pull ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-3a62fd2
docker run -p 8080:8080 -p 8090:8090 ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-3a62fd2

Then visit: http://localhost:8080

📝 Changes in this PR:
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge65.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge66.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/binaryexecution/BinaryExecutionHelper.java
- src/main/resources/explanations/challenge65.adoc
- src/main/resources/explanations/challenge65_hint.adoc
- src/main/resources/explanations/challenge65_reason.adoc
- src/main/resources/explanations/challenge66.adoc
- src/main/resources/explanations/challenge66_hint.adoc
- src/main/resources/explanations/challenge66_reason.adoc

Visual diff screenshots will be available shortly...


Preview built by GitHub Actions

@github-actions
Copy link
Copy Markdown

📸 Visual Diff Ready!

Screenshots comparing your changes with the main branch are available:

📁 Download Visual Diff Artifacts

🖼️ Included screenshots:

  • pr-home.png vs main-home.png - Welcome page comparison
  • pr-about.png vs main-about.png - About page comparison
  • pr-challenge.png vs main-challenge.png - Challenge page comparison

🔍 How to review:

  1. Download the artifact zip file
  2. Extract and compare the pr-* and main-* images side by side
  3. Look for visual differences in layout, styling, and content

💡 Tip: Use an image comparison tool or open both images in separate browser tabs to spot differences easily.


Visual diff generated by GitHub Actions • PR #2523

Comment thread src/main/resources/explanations/challenge66.adoc Outdated
@github-actions
Copy link
Copy Markdown

🌐 GitHub Pages Preview Ready!

Your static preview is now available at:
🔗 Preview PR #2523

📄 What's included:

For full functionality testing: Use the Docker preview instead.

🔄 Auto-updates: This preview will be updated automatically when you push new commits to this PR.


Static preview with Thymeleaf generation by GitHub Actions

@github-actions
Copy link
Copy Markdown

🔨 Preview Build Complete!

Your changes have been built and pushed to GitHub Container Registry.

🐳 Docker Image: ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-0c8267c

📦 Download & Test Locally:

  1. 📁 Download Docker Image Artifact (look for wrongsecrets-preview-pr-2523)
  2. Load and run the image:
# Download the artifact, extract it, then:
docker load < wrongsecrets-preview.tar
docker run -p 8080:8080 -p 8090:8090 wrongsecrets-preview

🚀 Alternative - Pull from Registry:

docker pull ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-0c8267c
docker run -p 8080:8080 -p 8090:8090 ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-0c8267c

Then visit: http://localhost:8080

📝 Changes in this PR:
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge65.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge66.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/binaryexecution/BinaryExecutionHelper.java
- src/main/resources/explanations/challenge65.adoc
- src/main/resources/explanations/challenge65_hint.adoc
- src/main/resources/explanations/challenge65_reason.adoc
- src/main/resources/explanations/challenge66.adoc
- src/main/resources/explanations/challenge66_hint.adoc
- src/main/resources/explanations/challenge66_reason.adoc

Visual diff screenshots will be available shortly...


Preview built by GitHub Actions

@commjoen
Copy link
Copy Markdown
Collaborator

@copilot can you make sure the new jar files also are laoded into the desktop containers?

Comment on lines +1 to +7
=== Hiding in binaries part 6: the plain Java CLI

Runnable JARs are not a safe place to hide secrets. Just like Android APKs, they are archives that ship bytecode and resources directly to the attacker, which makes embedded strings, constants, and helper methods straightforward to inspect with common reverse-engineering tools.

If a client-side Java artifact needs a secret to work, assume that secret can be extracted once the file is downloaded. Keep real secrets on a trusted backend and only release them after proper authentication and authorization.

If you want more Java and Android reverse-engineering practice, explore the https://github.com/OWASP/MASTG-Hacking-Playground[OWASP MASTG Hacking Playground].
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot can you move this to the challenge65_reason.adoc file instead? This file should tell the same story as challenge66.adoc (E.g. there is a cli in java, here you can find it, can you find the secret? you can either enter it into the box below or use the cli itself to see if it is correct)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the APK/JAR warning and MASTG link into challenge65_reason.adoc, rewrote challenge65.adoc to match the Challenge 66 task flow, and switched the JAR link to the direct raw file in 82f3b54. Screenshot: https://github.com/user-attachments/assets/d7a5da14-9ecd-4d99-a8d0-b3f426e562eb

Copilot AI temporarily deployed to github-pages May 18, 2026 08:03 Inactive
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 18, 2026

@copilot can you make sure the new jar files also are laoded into the desktop containers?

Updated both desktop container Dockerfiles so they now copy the new Java challenge JARs into /var/tmp/wrongsecrets/ in 20d311b.

@github-actions
Copy link
Copy Markdown

📸 Visual Diff Ready!

Screenshots comparing your changes with the main branch are available:

📁 Download Visual Diff Artifacts

🖼️ Included screenshots:

  • pr-home.png vs main-home.png - Welcome page comparison
  • pr-about.png vs main-about.png - About page comparison
  • pr-challenge.png vs main-challenge.png - Challenge page comparison

🔍 How to review:

  1. Download the artifact zip file
  2. Extract and compare the pr-* and main-* images side by side
  3. Look for visual differences in layout, styling, and content

💡 Tip: Use an image comparison tool or open both images in separate browser tabs to spot differences easily.


Visual diff generated by GitHub Actions • PR #2523

@github-actions
Copy link
Copy Markdown

🌐 GitHub Pages Preview Ready!

Your static preview is now available at:
🔗 Preview PR #2523

📄 What's included:

For full functionality testing: Use the Docker preview instead.

🔄 Auto-updates: This preview will be updated automatically when you push new commits to this PR.


Static preview with Thymeleaf generation by GitHub Actions

@github-actions
Copy link
Copy Markdown

🔨 Preview Build Complete!

Your changes have been built and pushed to GitHub Container Registry.

🐳 Docker Image: ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-745e64c

📦 Download & Test Locally:

  1. 📁 Download Docker Image Artifact (look for wrongsecrets-preview-pr-2523)
  2. Load and run the image:
# Download the artifact, extract it, then:
docker load < wrongsecrets-preview.tar
docker run -p 8080:8080 -p 8090:8090 wrongsecrets-preview

🚀 Alternative - Pull from Registry:

docker pull ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-745e64c
docker run -p 8080:8080 -p 8090:8090 ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-745e64c

Then visit: http://localhost:8080

📝 Changes in this PR:
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge65.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge66.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/binaryexecution/BinaryExecutionHelper.java
- src/main/resources/explanations/challenge65.adoc
- src/main/resources/explanations/challenge65_hint.adoc
- src/main/resources/explanations/challenge65_reason.adoc
- src/main/resources/explanations/challenge66.adoc
- src/main/resources/explanations/challenge66_hint.adoc
- src/main/resources/explanations/challenge66_reason.adoc

Visual diff screenshots will be available shortly...


Preview built by GitHub Actions

Copilot AI and others added 3 commits May 18, 2026 08:14
Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/24a041b5-fd38-429d-a6b5-f8f141ed817d

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/24a041b5-fd38-429d-a6b5-f8f141ed817d

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

📸 Visual Diff Ready!

Screenshots comparing your changes with the main branch are available:

📁 Download Visual Diff Artifacts

🖼️ Included screenshots:

  • pr-home.png vs main-home.png - Welcome page comparison
  • pr-about.png vs main-about.png - About page comparison
  • pr-challenge.png vs main-challenge.png - Challenge page comparison

🔍 How to review:

  1. Download the artifact zip file
  2. Extract and compare the pr-* and main-* images side by side
  3. Look for visual differences in layout, styling, and content

💡 Tip: Use an image comparison tool or open both images in separate browser tabs to spot differences easily.


Visual diff generated by GitHub Actions • PR #2523

@github-actions
Copy link
Copy Markdown

🌐 GitHub Pages Preview Ready!

Your static preview is now available at:
🔗 Preview PR #2523

📄 What's included:

For full functionality testing: Use the Docker preview instead.

🔄 Auto-updates: This preview will be updated automatically when you push new commits to this PR.


Static preview with Thymeleaf generation by GitHub Actions

@github-actions
Copy link
Copy Markdown

🔨 Preview Build Complete!

Your changes have been built and pushed to GitHub Container Registry.

🐳 Docker Image: ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-cd1a864

📦 Download & Test Locally:

  1. 📁 Download Docker Image Artifact (look for wrongsecrets-preview-pr-2523)
  2. Load and run the image:
# Download the artifact, extract it, then:
docker load < wrongsecrets-preview.tar
docker run -p 8080:8080 -p 8090:8090 wrongsecrets-preview

🚀 Alternative - Pull from Registry:

docker pull ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-cd1a864
docker run -p 8080:8080 -p 8090:8090 ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-cd1a864

Then visit: http://localhost:8080

📝 Changes in this PR:
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge65.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge66.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/binaryexecution/BinaryExecutionHelper.java
- src/main/resources/explanations/challenge65.adoc
- src/main/resources/explanations/challenge65_hint.adoc
- src/main/resources/explanations/challenge65_reason.adoc
- src/main/resources/explanations/challenge66.adoc
- src/main/resources/explanations/challenge66_hint.adoc
- src/main/resources/explanations/challenge66_reason.adoc

Visual diff screenshots will be available shortly...


Preview built by GitHub Actions

@github-actions
Copy link
Copy Markdown

📸 Visual Diff Ready!

Screenshots comparing your changes with the main branch are available:

📁 Download Visual Diff Artifacts

🖼️ Included screenshots:

  • pr-home.png vs main-home.png - Welcome page comparison
  • pr-about.png vs main-about.png - About page comparison
  • pr-challenge.png vs main-challenge.png - Challenge page comparison

🔍 How to review:

  1. Download the artifact zip file
  2. Extract and compare the pr-* and main-* images side by side
  3. Look for visual differences in layout, styling, and content

💡 Tip: Use an image comparison tool or open both images in separate browser tabs to spot differences easily.


Visual diff generated by GitHub Actions • PR #2523

@commjoen commjoen merged commit dc284f1 into master May 19, 2026
20 checks passed
@commjoen commjoen deleted the copilot/add-cli-challenge-variants branch May 19, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants